package com.wanmait.myhouse.dao;

import com.wanmait.myhouse.util.DBHelper;
import com.wanmait.myhouse.vo.SellManner;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;

import javax.sql.rowset.spi.SyncResolver;
import java.sql.SQLException;
import java.util.List;

public class SellMannerDAO {
    public List<SellManner> selectAll(){
        QueryRunner queryRunner = new QueryRunner(DBHelper.getDruidDataSource());
        String sql = "select * from t_sellManner";
        try {
            List<SellManner> sellMannerList = queryRunner.query(sql, new BeanListHandler<>(SellManner.class));
            return sellMannerList;
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
        return null;
    }
}
